package com.link.base.base.invloc.service;

import com.link.base.base.invloc.model.InvProdLoc;
import com.link.base.base.invloc.model.InventoryModel;
import com.link.base.base.product.model.Product;
import com.link.core.basic.dao.mapper.BasicMapper;
import com.link.core.basic.service.BasicServiceException;
import com.link.core.basic.service.BasicServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author: unknown
 * created: unknown
 * comments:
 */
@Service
@Transactional(rollbackFor = BasicServiceException.class)
public class InvProdLocServiceImpl extends BasicServiceImpl<InvProdLoc> implements InvProdLocService {

    @Resource
    private com.link.base.base.invloc.dao.mybatis.mapper.InvProdLocMapper InvProdLocMapper;

    @Override
    public BasicMapper<InvProdLoc> getBasicMapper() {
        return InvProdLocMapper;
    }

    /**
     按照id查询产品库存量
     */
    @Override
    public InvProdLoc queryInvProdLocBystockId(InvProdLoc record) throws Exception {
        return InvProdLocMapper.queryInvProdLocBystockId(record);
    }

    /***
     * 库存查询
     * @param inventoryModel
     * @return
     * @throws Exception
     */
    @Override
    public List<InventoryModel> queryVendorInvprodPage(InventoryModel inventoryModel) throws Exception {
        return InvProdLocMapper.queryVendorInvprodPage(inventoryModel);
    }

    @Override
    public List<Product> queryBuySuggestReport(Product product) throws Exception {
        return InvProdLocMapper.queryBuySuggestReport(product);
    }
}
